package com.jar.exercise.多线程.threadlocal;

public class InheritableThreadLocalDemo implements Runnable{
    private static InheritableThreadLocal threadLocal = new InheritableThreadLocal();

    public static void main(String[] args) {
        threadLocal.set("张三");
        new Thread(new InheritableThreadLocalDemo()).start();

    }


    @Override
    public void run() {
        Object o = threadLocal.get();
        System.out.println("子线程：："+o);
    }
}
